<template>
	<view>
		<UniNavBar title="评价管理" />
		<list-page @scrolltolower="scrolltolower" :loadMoreStatus="empty">
			<view class="worp">
				<view class="commit_box" v-for="item in list" :key="item.id">
					<view class="c_worp">
						<view class="c_title">
							{{item.name}}
						</view>
						<view class="commit_v">
							<view class="commit_v_c">
								<text class="c_number">{{item['好评']}}%</text>
								<text class="c_text">好评</text>
							</view>
							<view class="commit_v_c">
								<text class="c_number">{{item['中评']}}%</text>
								<text class="c_text">中评</text>
							</view>
							<view class="commit_v_c">
								<text class="c_number">{{item['差评']}}%</text>
								<text class="c_text">差评</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</list-page>

		<u-loading-page :loading="loading"></u-loading-page>
	</view>
</template>

<script>
	import UniNavBar from "@/components/uniNavbar/index.vue"
	import ListPage from "@/components/listPage/index.vue"
	import Empty from "@/components/empty.vue"
	import {
		evaluate
	} from "../../api/common"
	export default {
		components: {
			UniNavBar,
			ListPage
		},
		data() {
			return {
				list: [],
				loading: false,
				params: {
					page: 1,
					limit: 999,
				},
				loading: false,
			}
		},
		computed: {
			isLoading() {
				return this.loading === false && this.list.length != 0
			},
			empty() {
				return this.list.length === 0 && this.loading === false
			}
		},
		onShow() {
			this.getevaluation()
		},
		methods: {
			// 加载
			scrolltolower() {
				this.params.page++
				this.getComplaintList()
			},
			getevaluation() {
				evaluate().then(res => {
					console.log(res, '4223');
					this.list = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.commit_box {
		background: #FFFFFF;
		box-shadow: 1px 10px 9px 0px rgba(133, 133, 133, 0.04);
		border-radius: 10px;
		min-height: 210rpx;
		width: 702rpx;
		margin-bottom: 30rpx;

		.c_worp {
			padding: 18rpx 0;
		}

		.c_title {
			font-size: 35rpx;
			font-family: Microsoft YaHei;
			font-weight: 400;
			text-align: center;
			color: #666666;
		}

		.commit_v {
			display: flex;
			align-items: center;
			margin-top: 50rpx;

			.commit_v_c {
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				.c_number {
					font-size: 45rpx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: #6750F8;
					margin-bottom: 21rpx;
				}

				.c_text {
					font-size: 30rpx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: #444444;
				}
			}
		}
	}
</style>